package tech.luoyu.ki.util;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

public class SessionUtil {
	public static Object getAttribute(String attributeName) {
		Subject currentUser = SecurityUtils.getSubject();
		Session session = currentUser.getSession();
		return session.getAttribute(attributeName);
	}

	public static void setAttribute(String attributeName, Object attributeValue) {
		Subject currentUser = SecurityUtils.getSubject();
		Session session = currentUser.getSession();
		session.setAttribute(attributeName, attributeValue);
	}
}
